home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9282 < prev    next >
Encoding:
Text File  |  1996-08-05  |  868 b   |  39 lines

  1. Path: aix11.hrz.uni-oldenburg.de!news1 
  2. From: weichert@neuro.uni-oldenburg.de (Andreas Weichert)
  3. Newsgroups: comp.lang.c++
  4. Subject: Why doesn┤t work _fmemcpy > 64kB
  5. Date: 29 Feb 1996 12:23:03 GMT
  6. Organization: KOSY
  7. Message-ID: <4h45r7$apq@aix11.hrz.uni-oldenburg.de>
  8. NNTP-Posting-Host: lin2.physik.uni-oldenburg.de
  9. X-Newsreader: WinVN 0.92.2
  10.  
  11.  
  12. How can I copy data >64kB with Borland C++ 4.0.
  13. _fmemcopy works only up to the 3615. Element.
  14.  
  15.  
  16. int main(void)
  17. {
  18. long i;
  19. const long Size=20000;
  20. float huge *p1;
  21. float huge *p2;
  22. p1=(float* huge)farcalloc(Size,sizeof(float));
  23. for(i=0;i<Size;i++)    p1[i]=1;
  24. p2=(float* huge)farcalloc(Size,sizeof(float));
  25. for(i=0;i<Size;i++)    p2[i]=2;
  26. _fmemcpy((void* huge) p2,(void* huge) p1,Size*sizeof(float));
  27. cout<<p2[Size-1];    // -> 1
  28.  
  29. cout<<endl;
  30. for(i=0;i<Size;i++)
  31.     if(p2[i]!=1) {cout<<i; break; }   // ->3616
  32.  
  33.  
  34.  
  35. return(0);
  36. }
  37.  
  38.  
  39.